<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ page import ="java.sql.*" %>

<%@ page import ="javax.sql.*" %>
<%@ page import="servlets.ValidarReserva" %>
<%@ page import="repository.GenericConector" %>
<%

GenericConector c = new GenericConector();
ResultSet rpq = c.getListaPaquetesHechos();



%>




<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Modificar Reserva paso 1</title>

<script>
function actualizarTabla(select){
	
	  var option = select.options[select.selectedIndex];
	  var text =option.firstChild.data +"";
	 // alert(text);
	  	 
	  var p = text.split("--");
	  var tbl = "<center><table>";
		for (var i = 0;i<p.length;i++)
			{
			
			var s = p[i].split(":"); //nombrE:valor
			
			tbl+="<tr><td><b>" + s[0] + "</b></td><td>" + s[1] +"</td></tr>";
			
			}
		tbl += "</table></center>";
	  var ds = document.getElementById("tblcambiar")
	  ds.innerHTML = tbl;
	
}
</script>


<style type="text/css">
<!--
#apDiv1 {
	position:absolute;
	left:20px;
	top:20px;
	width:635px;
	height:539px;
	z-index:1;
	right: auto;
}
#apDiv2 {
	position:absolute;
	left:136px;
	top:95px;
	width:573px;
	height:49px;
	z-index:2;
	
}
#apDiv3 {
	position:absolute;
	left:136px;
	top:171px;
	width:575px;
	height:257px;
	z-index:3;
	background-image: url(images/tpwebbg2.png);
}
body {
	background-color: #CCCCCC;
}
.Estilo1 {color: #FF0000;
font-size:18px;}
-->
</style>
</head>
<body>

<div id="apDiv1">
<div id="apDiv2">
  <div align="center" class="Estilo1"><img src="images/tpmodificar.png"><!-- Generar Reserva --></div>
</div>
<div id="apDiv3">
  <table width="100%" border="0" align="center">
    <tr>
      <td>&nbsp;</td>
      <td>Seleccionar Reserva a Modificar</td>
      
         <form id="form1" name="form1" method="post" action="SelectReserva">
      
      <td><select name="reservaId" id="reservaId" onchange="actualizarTabla(this)">
      
      
      
      
      <% 
			while(rpq.next()) 
			{ 	
				out.println("<option value='"+rpq.getString(1)+"'>"+rpq.getString(2)+"</option>"); 
				
				
			} 

		%>
      
      
      
      </select>
      <script>
      actualizarTabla(document.getElementById("reservaId"));//init.
      </script>
      </td>
      <td>&nbsp;</td>
   
    </tr>
    
    <tr>
     
      <td id="tblcambiar"  colspan="4">&nbsp;</td>
      <!--  <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td> -->
    </tr>    
    <tr>
      <td>&nbsp;</td>
      <td>
       
      </td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="2">
        <center>
        <input type="submit" name="envairreserva" id="envairreserva" value="Modificar Reserva" />
        <input type="button" onclick='location.href="Index.jsp"' value='Volver'/>
        </center>
      </form>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</div>
</div>







</body>
</html>

